home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_05 / allison / share.cpp < prev    next >
C/C++ Source or Header  |  1994-03-23  |  286b  |  17 lines

  1. LISTING 12 - Shows that tags and variables share the same
  2. namespace
  3. #include <iostream.h>
  4.  
  5. struct pair {int x; int y;};
  6.  
  7. main()
  8. {
  9.     int pair = 0;
  10.     pair p = {pair,pair};     // error
  11.  
  12.     cout << pair << endl;
  13.     cout << p.x << ',' << p.y << endl;
  14.     return 0;
  15. }
  16.  
  17.